<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
import request from '@/utils/request'
export default {
  name: "App",
  computed: {
    userInfo() {
      return JSON.parse(sessionStorage.getItem("userInfo"));
    },
  },
  mounted() {
    window.addEventListener(
      "mousedown",
      (e) => {
        this.setTimer();
      },
      false
    );
    window.addEventListener(
      "mousemove",
      (e) => {
        this.setTimer();
      },
      false
    );
    window.addEventListener(
      "keyup",
      (e) => {
        this.setTimer();
      },
      false
    );
    window.addEventListener(
      "scroll",
      (e) => {
        this.setTimer();
      },
      false
    );
  },
  methods: {
    setTimer() {
      if (this.timer) clearTimeout(this.timer);
      if (sessionStorage.getItem("userInfo")) {
        this.timer = setTimeout(() => {
          sessionStorage.clear();
          this.$alert("您已经超过30分钟未操作，请重新登录", "提示", {
            confirmButtonText: "确定",
            callback: () => {
              this.$router.push("/login");
            },
          });
        }, 30 * 60 * 1000);
      }
    },
  },
};
</script>

<style>
/* @import '@/asstes/css/reset.css' */
body {
  padding: 0;
  margin: 0;
  background-color:#f6f8fb ;
  
}
.el-input__inner {
  height: 34px !important;
  line-height: 34px !important;
}
#app{
  font-family: '微软雅黑';
  
}
.el-table{
  background-color: #ffffff;
}


/*滚动条*/
::-webkit-scrollbar {
  width: 6px;
  height: 12px;
  background-color: #f0f0f0;
}

/*滑块*/
::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background-color: #c2c2c2;
}

/*鼠标放在滑块上的样式*/
::-webkit-scrollbar-thumb:hover {
  background-color: #aaaaaa;
}

</style>
